package com.kklsqm.langchain4j.config;

import dev.langchain4j.memory.ChatMemory;
import dev.langchain4j.memory.chat.MessageWindowChatMemory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 功能:
 * 作者: 沙琪马
 * 日期: 2025/5/7 13:59
 */
@Configuration
public class MemoryChatAssistantConfig {

    @Bean("chatMemory")
    public ChatMemory chatMemory() {
        return MessageWindowChatMemory.withMaxMessages(10);
    }

}
